package field_method05;

public class FruitTest {
        public static void main(String[] args) {
            Fruit apple = new Apple();
            apple.setName("苹果");
            apple.setArea("昭通");
            apple.setPrice(5.0);
            apple.setType("红富士");
            Fruit watermelon = new Watermelon();
            watermelon.setName("西瓜");
            watermelon.setArea("四川");
            watermelon.setPrice(10.0);
            watermelon.setType("青皮");
            Fruit pear = new Pear();
            pear.setName("梨");
            pear.setArea("云南");
            pear.setPrice(8.0);
            pear.setType("高原梨");
            System.out.println("水果：" + apple.getName() + "，品种：" + apple.getType() + "，产地：" + apple.getArea() + "，价格：" + apple.getPrice() + "元/斤");
            System.out.println("水果：" + watermelon.getName() + "，品种：" + watermelon.getType() + "，产地：" + watermelon.getArea() + "，价格：" + watermelon.getPrice() + "元/斤");
            System.out.println("水果：" + pear.getName() + "，品种：" + pear.getType() + "，产地：" + pear.getArea() + "，价格：" + pear.getPrice() + "元/斤");

        }
    }

